package lx.springBoot.bean;

import lx.springBoot.activeMq.ActiveMqConfig;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTempTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import javax.jms.Queue;
import javax.jms.Topic;

/**
 * Created by lx on 2017/7/8.
 * ActiveMQ 相关Bean
 */
@Component
public class ActiveMqBean {

    @Bean("topic")
    public Topic topic(){
        return new ActiveMQTempTopic(ActiveMqConfig.TOPIC);
    }

    @Bean("queue")
    public Queue queue(){
        return new ActiveMQQueue(ActiveMqConfig.QUEUE);
    }
}
